// 重载
function padding(all: number);
function padding(topAndBottom: number, leftAndRight: number);
function padding(top: number, right: number, bottom: number, left: number);
// Actual implementation that is a true representation of all the cases the function body needs to handle
function padding(a: number, b?: number, c?: number, d?: number) {
	if (b === undefined && c === undefined && d === undefined) {
		b = c = d = a;
	} else if (c === undefined && d === undefined) {
		c = a;
		d = b;
	}
	return {
		top: a,
		right: b,
		bottom: c,
		left: d
	};
}
let a = padding(3, 5, 6, 8);
console.log(a);

export { padding };

const simple: (foo: number) => string = (foo) => foo.toString();
